<?php

/*
 * Date config
 */
$extContent = "
jQuery( function() {
    inputs = jQuery(':input');
    jQuery(inputs).keypress( function(e) {
        if( e.which == 13 && jQuery(this).attr('type') != 'textarea' ) {
            inputs[inputs.index(this)+1].select();
        }
        
    });
    jQuery('#BIRTH_DATE').datepicker({
        changeYear: true,
        changeMonth: true,
        showOn: 'both',
        buttonImageOnly: true,
        buttonImage: '../../img/calendar.gif',
        dateFormat: 'yy-mm-dd',
        dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
        dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
        monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
        minDate: '-100y',
        maxDate: '+10y',
        yearRange: 'c-100:c+100',
        prevText: 'Anterior',
        nextText: 'Siguiente',
        onSelect: function(date) {
            calcEdad(date);
        } 
    });    
});
try{
  calcEdad=function(fNac){
		 birthDate=new Date(fNac);
		 new_date = new Date;  
		 diff = new_date - birthDate;  
		 age_in_years = diff/(1000*60*60*24*365);  
		 $('edad').update(Math.floor(age_in_years)+' A&ntilde;os');	
  }
  /*if($('BIRTH_DATE')!=null){
  	new Control.DatePicker('BIRTH_DATE', {icon: '../../js/protocalendar/calendar.png',
		dateFormat: 'yyyy-MM-dd',
		locale:'es',
		onSelect:calcEdad});
  }*/
  }catch(e){}
   TabbedPanels = new Spry.Widget.TabbedPanels('panel');
";
?>